package fh.hof.lucene.view;

import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;




public class MainView extends JFrame {
	
	private JTextField searchTextField = new JTextField();
	private JButton searchButton = new JButton("Suche");
	private JButton addButton = new JButton("ADD");
	private JPanel contentPane;
	
	
	public MainView(){
		
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setTitle("HotDoc");
		this.setSize(640,480);
		
		
		contentPane = (JPanel) getContentPane();
		contentPane.setLayout(new BorderLayout());
		contentPane.add(searchTextField, BorderLayout.NORTH);
		contentPane.add(addButton, BorderLayout.CENTER);
		
		ActionListener alAdd = new ActionListener (){
			
			public void actionPerformed(ActionEvent e){
				AddDialog addDialog = new AddDialog();
				addDialog.setTitle("Add document");
				addDialog.setSize(new Dimension (640,480));
				addDialog.setVisible(true);
				
			}

		};
		
		addButton.addActionListener(alAdd);
		
	}
	
	
	public static void main (String [] args){
		
		MainView window = new MainView();
		window.setVisible(true);
	}
	

}
